ci(gui): stop pnpm side-effects cache poisoning of Electron installs - #4
Merged
Merged
Conversation
The gui (lint/typecheck) job installs with ELECTRON_SKIP_BINARY_DOWNLOAD=1, and pnpm's side-effects cache (default on) records that binary-less Electron postinstall in the pnpm store. setup-node caches the store keyed only on OS + lockfile hash, and the fast job wins the immutable cache save — so the smoke job (and the Linux release build) restores the poisoned store, pnpm replays the recorded postinstall instead of running it, node_modules/electron never gets dist/, and electron.launch dies with "Electron failed to install correctly". Pass --config.side-effects-cache=false at all three install sites: the gui job stops writing the poisoned entry, and the smoke/release installs stop trusting any existing one (the already-saved cache entry is immutable until the lockfile changes, so fixing only the producer would not unbreak CI). Verified with a local repro on pnpm 9.15.0: a fake package whose postinstall skips its binary under the env var; a second env-free install through the same store silently replayed the skip, and the flag made it really run. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The GUI smoke lane fails on CI with:
Root cause
A poisoned shared pnpm store cache — not a flaky download:
gui.yml(and the ubuntu release build ingui-release.yml) share one pnpm store cache viasetup-node'scache: pnpm, keyed only on OS/arch +pnpm-lock.yamlhash.guijob deliberately installs withELECTRON_SKIP_BINARY_DOWNLOAD=1. Electron's postinstall runs but downloads nothing — and pnpm's side-effects cache (on by default) records that binary-less postinstall result in the store.smokejob restores the poisoned store and pnpm replays the recorded postinstall instead of running it.node_modules/electron/distnever appears →electron.launchthrows.This also explains why the lane passed at first (cache miss → real install) and broke later with no GUI change.
Fix
Pass
--config.side-effects-cache=falseat all three install sites:gui.ymlguijob — stops writing the poisoned entry at the sourcegui.ymlsmokejob — stops reading any existing poisoned entry; required for CI to pass immediately, since the bad cache entry for the current lockfile hash is already saved and immutablegui-release.yml— the ubuntu runner shares the same cache key and runs the same smoke testTrade-off: these jobs re-run postinstalls each time (the smoke job re-downloads the ~100 MB Electron binary per run) instead of replaying them; package tarball caching is unaffected. No manual cache eviction needed.
Verification
Reproduced and verified locally on pnpm 9.15.0 (the version CI pins via Corepack) with a minimal fake package whose postinstall skips creating its "binary" under
ELECTRON_SKIP_BINARY_DOWNLOAD:--config.side-effects-cache=false --frozen-lockfile→ postinstall really ran, binary presentBoth workflow files parse as valid YAML.
🤖 Generated with Claude Code